package com.example.springbootsfzy.service.liujinping;

import com.example.springbootsfzy.domain.ConsultationAppointments;
import com.example.springbootsfzy.domain.MemberInfo;
import com.example.springbootsfzy.domain.PsychologicalKnowledge;
import com.example.springbootsfzy.mapper.ConsultationAppointmentsMapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ConsultationAppointmentsService {
    @Autowired
    private ConsultationAppointmentsMapper consultationAppointmentsMapper;
    public int insertSelective(ConsultationAppointments record){
     return consultationAppointmentsMapper.insert(record);
    }
    public int deleteByPrimaryKey(Long id){
        return consultationAppointmentsMapper.deleteByPrimaryKey(id);

    }
    public int updateByPrimaryKey(ConsultationAppointments record){
        return consultationAppointmentsMapper.updateByPrimaryKey(record);
    }
    public ConsultationAppointments selectByPrimaryKey(Long id){
        return consultationAppointmentsMapper.selectByPrimaryKey(id);
    }
    public int updateByPrimaryKeySelective(ConsultationAppointments record){
        return consultationAppointmentsMapper.updateByPrimaryKeySelective(record);
    }
    public List<ConsultationAppointments> selectAll(){
        return consultationAppointmentsMapper.selectAll();
    }

    public MemberInfo selectAllByPage(Integer memberId) {
        MemberInfo consultationAppointments = consultationAppointmentsMapper.seletAllconsultationAppointmentBypage(memberId);
        return consultationAppointments;
    }



    //以咨询师id查咨询信息  并进行分页
    public PageInfo<ConsultationAppointments> selectAllByConsultationAppointments(int pageNum, int pageSize, ConsultationAppointments consultationAppointments) {
        PageHelper.startPage(pageNum,pageSize);
        List<ConsultationAppointments> consultationAppointments1 = consultationAppointmentsMapper.selectAllByConsultationAppointments(consultationAppointments);
        PageInfo<ConsultationAppointments> pageInfo = new PageInfo<>(consultationAppointments1);
        return pageInfo;

    }
}




//    int deleteByPrimaryKey(Long id);
//
//    int insert(ConsultationAppointments record);
//
//
//    ConsultationAppointments selectByPrimaryKey(Long id);
//
//    int updateByPrimaryKeySelective(ConsultationAppointments record);
//
//    int updateByPrimaryKey(ConsultationAppointments record);
//selectAll